package lab01;
import java.util.Scanner;

public class Test12 {
    public static void main(String[] args) {
        System.out.println("请输入1到9999之间的数");
        Scanner sc = new Scanner(System .in);
        int palindrome = sc.nextInt();
        if(palindrome>=1 && palindrome<=9){
            System.out.println(palindrome+"是个位数");
                System.out.println(palindrome+"是回文数");
        }
        if (palindrome>=10&&palindrome<=99){
            System.out.println(palindrome+"是两位数");
            System.out.println(palindrome+"不是回文数");
        }
        if (palindrome >=100&&palindrome<=999){
            System.out.println(palindrome+"是三位数");
            int h = palindrome/10/10%10;
            int t = palindrome/10%10;
            int s = palindrome%10;
            if(s*100+t*10+h == palindrome){
                System.out.println(palindrome+"是回文数");
            }
        }
        if(palindrome >=1000&&palindrome<=9999){
            System.out.println(palindrome+"是四位数");
            int k =palindrome/10/10/10%10;
            int h =palindrome/10/10%10;
            int t =palindrome/10%10;
            int s =palindrome%10;
            if(s*1000+t*100+h*10+k == palindrome){
                System.out.println(palindrome+"是回文数");
            }
        }
    }
}
